package com.quan.system.service.impl;

import java.io.Serializable;
import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.quan.common.core.MyBaseServiceImpl;
import com.quan.system.entity.SystemRole;
import com.quan.system.mapper.SystemRoleMapper;
import com.quan.system.service.SystemRolePermissionService;
import com.quan.system.service.SystemRoleService;

/**
 * <p>
 * 系统-角色 服务实现类
 * </p>
 *
 * @author 杨浩泉
 * @since 2019-06-06
 */
@Service
public class SystemRoleServiceImpl extends MyBaseServiceImpl<SystemRoleMapper, SystemRole> implements SystemRoleService {

	@Autowired
	private SystemRolePermissionService rolePermissionService;
	
	@Override
	public boolean removeByIds(Collection<? extends Serializable> idList) {
		boolean falg = super.removeByIds(idList);
		
		idList.forEach(id -> {
			this.rolePermissionService.deleteByRoleId(id);
		});
		
		return falg;
	}

}
